package com.zheng.study.base.bean.search.page;

import com.zheng.study.base.bean.search.projection.Projection;
import com.zheng.study.base.bean.search.projection.ProjectionHelp;

/**
 * 查询 - 参数 - Page 帮助类
 * ============================================================================
 * author : dzw
 * createDate:  2018/6/12 。
 * ============================================================================
 */
public class PageHelp {

	/**
	 * 列表
	 */
	public static PageList list(){
		return PageList.list();
	}

	/**
	 * 分页列表
	 */
	public static PagePaging page(Integer pageNumber, Integer pageSize){
		return PagePaging.page(pageNumber, pageSize);
	}

	/**
	 * 对象
	 */
	public static PageUnique uniqueResult(){
		return PageUnique.uniqueResult();
	}

	/**
	 * 对象
	 */
	public static PageUnique uniqueResult(Projection projection){
		return PageUnique.uniqueResult(projection);
	}

	/**
	 * 行数
	 */
	public static PageUnique rowCount(){
		return PageUnique.uniqueResult(ProjectionHelp.rowCount());
	}

	/**
	 * 行数
	 */
	public static PageUnique count(String field) {
		return PageUnique.uniqueResult(ProjectionHelp.count(field));
	}

	/**
	 * 行数
	 */
	public static PageUnique countDistinct(String field) {
		return PageUnique.uniqueResult(ProjectionHelp.countDistinct(field));
	}

	/**
	 * 最大值
	 */
	public static PageUnique max(String field) {
		return PageUnique.uniqueResult(ProjectionHelp.max(field));
	}

	/**
	 * 最小值
	 */
	public static PageUnique min(String field) {
		return PageUnique.uniqueResult(ProjectionHelp.min(field));
	}

	/**
	 * 平均值
	 */
	public static PageUnique avg(String field) {
		return PageUnique.uniqueResult(ProjectionHelp.avg(field));
	}

	/**
	 * 和
	 */
	public static PageUnique sum(String field) {
		return PageUnique.uniqueResult(ProjectionHelp.sum(field));
	}

}
